package cn.yitun.chat.yitunserverimapicore.business.personal.service;

import cn.yitun.chat.yituncommonmessage.Info;
import cn.yitun.chat.yituncommonmessage.impl.HeadImpl;
import cn.yitun.chat.yituncommonmessage.result.ResultMessage;
import cn.yitun.chat.yitunservercommonlib.crud.yitun.CrudService;
import cn.yitun.chat.yitunservercommonlib.dataentity.dto.system.user.UserDto;
import cn.yitun.chat.yitunservercommonlib.dataentity.dto.system.user.UserExtendsDto;
import cn.yitun.chat.yitunservercommonlib.dataentity.dto.userchat.SecurityQuestionDto;
import cn.yitun.chat.yitunservercommonlib.dataentity.dto.userchat.UserHeadDto;
import cn.yitun.chat.yitunservercommonlib.dataentity.po.system.user.UserExtendsInfo;
import cn.yitun.chat.yitunservercommonlib.dataentity.vo.system.user.UserExtendsVo;
import cn.yitun.chat.yitunservercommonlib.dataentity.vo.userchat.UserHeadVo;
import cn.yitun.chat.yitunservercommonmessage.data.user.LoginDto;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Date 2019-01-20 09:40:46<br>
 * Description 个人业务处理service
 * @author yitun<br>
 * @version 1.1
 */
public interface PersonalService
		extends CrudService<UserExtendsDto, UserExtendsInfo, UserExtendsVo>{


	/**
	 * Description 登录 <br>
	 * Date 2019-04-30 09:56:08<br>
	 * @param loginData
	 * @return ResultMessage
	 * @since 1.0.0
	 */
	@Transactional(readOnly = true)
	ResultMessage login(LoginDto loginData);

	/**
	 * 注册
	 * 
	 * @param user
	 * @return
	 */
	@Transactional
	Info register(UserDto user, List<SecurityQuestionDto> list) ;

	/**
	 * 
	 * Date 2019-01-20 11:21:08<br>
	 * Description 修改用户信息
	 * 
	 * @param user
	 * @return
	 * @author yitun<br>
	 * @version 1.1
	 */
	@Transactional
	Info updatePersonal(UserDto user);

	/**
	 * 
	 * Date 2019-01-20 11:27:30<br>
	 * Description 修改密码
	 * 
	 * @param userId
	 * @param oldPassword
	 * @param newPassword
	 * @return
	 * @author yitun<br>
	 * @version 1.1
	 */
	@Transactional
	ResultMessage updatePassword(Long userId, String oldPassword, String newPassword);

	/**
	 * 
	 * Date 2019-01-20 11:21:48<br>
	 * Description 用户上传图像
	 * 
	 * @author yitun
	 * @param userHead
	 * @return
	 * @since 1.0.0
	 */
	@Transactional
	ResultMessage uploadHead(UserHeadDto userHead);

	/**
	 * 
	 * Date 2019-01-20 11:26:52<br>
	 * Description 修改个性签名
	 * yitun
	 * @param userId
	 * @param signature
	 * @return
	 * @since 1.0.0
	 */
	@Transactional
	boolean updateSignature(Long userId, String signature);

//	void updateStatus(Long userId, String status) ;

	UserHeadVo getUserHeadByUserId(Long userId);

	/**
	 * 更新用户聊天状态
	 * @param key
	 * @param chatOnline
	 * @return
	 */
    void updateChatOnlineStatus(Long key, String chatOnline);
}
